<extend name="Public:base" />
<block name="content">

<div id="primary" class="inner group">
    <div id="respond"  style="width:770px;position:relative;left:100px" >
		<h3 id="reply-title">修改密码</h3>
		
		<form id="commentform" method="post" action="/home/login/login/domima">							
		
			<p class="comment-form-author">
                <label for="author">用户名</label> 
                <input type="text" aria-required="true" size="30" readonly value="{$res['username']}" name="username" id="username"><span style="color:red"></span>
            </p>
            
            <p class="comment-form-email">
                <label for="email">旧密码</label> 
                <input type="password" aria-required="true" size="30" value="" name="oldpassword" id="oldpassword"><span style="color:red"></span>
            </p>
            <p class="comment-form-email">
                <label for="email">新密码</label> 
                <input type="password" aria-required="true" size="30" value="" name="password" id="password"><span style="color:red"></span>
            </p>
            <p class="comment-form-email">
                <label for="email">重复新密码</label> 
                <input type="password" aria-required="true" size="30" value="" name="repassword" id="repassword"><span style="color:red"></span>
            </p>
            <p class="form-submit">
                <input type="submit" value="修改" id="submit" name="submit">
            </p>
			
			<div class="clear"></div>
		
		</form>
	</div>
</div>

                    <script type="text/javascript">
                        var flag2=false;
                        var flag3=false;
                        var flag4=false;
                        
                        //旧密码
                        $('input[name="oldpassword"]').blur(function(){     
                             oldpassword=$(this).val();
                            if(oldpassword==''){
                                $(this).next().css('display','block'); 
                                $(this).next().html('旧密码不能为空');
                                flag2=false;
                            }else{
                                $(this).next().css('display','none'); 
                                flag2=true;
                            }
                        }); 
                        //新密码
                        $('input[name="password"]').blur(function(){     
                             password=$(this).val();
                            if(password==''){
                                $(this).next().css('display','block'); 
                                $(this).next().html('新密码不能为空');
                                flag3=false;
                            }else{
                                $(this).next().css('display','none'); 
                                flag3=true;
                            }
                        });
                        //重复新密码
                        $('input[name="repassword"]').blur(function(){     
                            var repassword=$(this).val();
                            if(repassword==''){
                                $(this).next().css('display','block'); 
                                $(this).next().html('重复密码不能为空');
                                flag4=false;
                            }else{
                                if(password==repassword){
                                    $(this).next().css('display','none'); 
                                    flag4=true;
                                }else{
                                    $(this).next().css('display','block'); 
                                    $(this).next().html('两次新密码不一致'); 
                                    flag4=false;
                                }
                                
                            }
                        });
                        
                       $('input[name=submit]').click(function(){
                            if(flag2&&flag3&&flag4){
                                return true; 
                            }else{
                                return false;
                            }
                       });
                    </script>
</block>